package com.test.servlet;

import java.io.IOException;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class SimpleHttpServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		System.out.println("doGet");
		//resp.setContentType("text/html");
		
		Enumeration e = req.getParameterNames();
		System.out.println("abc");
		while(e.hasMoreElements()){
			System.out.println(e.nextElement());
			System.out.println(req.getParameter((String) e.nextElement()) );
			req.getParameter("taotao");
		}
		
		
		resp.getOutputStream().write("it is OK".getBytes());
	}
	
	public void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		System.out.println("doGet");
		resp.getOutputStream().write("it is OK".getBytes());
	}
}
